if [ $# == 2 ]; then
	echo -n ""
else
	echo "usage: run-all.sh  #itr-start  #itr-end"
	echo "ex:    run-all.sh  0 3"
	exit
fi

copyopt=`cat info/copyopt.var`
symm=`cat info/symm.var`
lang=`cat info/lang.var`

freq=2
prob=0

if [ $lang == ek ] ; then
fi


for i in $(seq $1 $2); do

	echo iteration-$i $type $symm
	log=log_all.${i}; rm -rf $log
	echo -n "[Start] " >> $log
	date >> $log
	echo "WA" >> $log
	cd i${i}

	# WA
	cd wa;
	make realall
	./eval.sh >> ../../$log
	crossnum ${symm}-train.giza >> ../../$log
	cd ..;

	# TRAIN
	echo "[COPYCAT-TRAIN] " >> ../$log
	date >> ../$log
	./copycat-train.sh;


	# APPLY
	echo "[COPYCAT] " >> ../$log
	date >> ../$log
	./copycat.sh $freq $prob
#cat copycat/info.txt >> ../$log

	# smt
	echo "[SMT] " >> ../$log
	cd smt
	make realall_$lang
	make bleu_eval_$lang >> ../../$log
#	make clean
	cd ..

	# NEXT
	./make-next.sh;

	# end
	echo -n "[End] " >> ../$log
	date >> ../$log
	cd ..

done

